package com.demo.gulimall.product.entity;

import java.util.Date;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.io.Serializable;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * @author Chen Yuan
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("undo_log")
public class UndoLog implements Serializable {
	@TableId(type = IdType.ID_WORKER) // 老版本
    //@TableId(type = IdType.ASSIGN_ID) // 新版本
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`id`")
	private Long id;

	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`branch_id`")
	private Long branchId;

	@TableField(value = "`xid`")
	private String xid;

	@TableField(value = "`context`")
	private String context;

	@TableField(value = "`rollback_info`")
	private Byte[] rollbackInfo;

	@TableField(value = "`log_status`")
	private Integer logStatus;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
	@TableField(value = "`log_created`")
	private Date logCreated;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
	@TableField(value = "`log_modified`")
	private Date logModified;

	@TableField(value = "`ext`")
	private String ext;

}
